//
//  PageManager.h
//  HealthCard
//
//  Created by leon on 13-9-9.
//  Copyright (c) 2013年 xxx. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "PMViewController.h"
/*
 *页面管理器
 *负责从配置文件中读取页面配置和导航栏控制器配置
 *负责页面的创建、管理、跳转、释放等操作
 */

@class PMNavigationController;
@interface PageManager : NSObject<UITabBarControllerDelegate,UINavigationControllerDelegate>
{
@private
    //data source
    NSMutableDictionary*                _dataPageCfg;
    NSMutableArray*                     _dataNaviCfg;
    NSMutableDictionary*                _controllerPool;
    NSMutableDictionary*                _navigationPool;
    PMNavigationController*             _curStack;
}
@property(nonatomic,strong) NSURL* naviCfgURL;
@property(nonatomic,strong) NSURL* pageCfgURL;
@property(nonatomic,strong,readonly) UITabBarController* root;
@property(nonatomic,strong) PMNavigationController* pmNavi;
@property(nonatomic,assign) BOOL useMutilLayer;
@property(nonatomic,strong) UIColor* naviBarTextColor;
@property(nonatomic,strong) UIImage* naviBarBackImage;
@property(nonatomic,strong) UIColor* naviBarBackColor;
@property(nonatomic,strong) UIImage* tabBarBackImage;

/*
 *页面管理器单例
 */
+ (PageManager*)shareInstance;

/*
 *跳转到对应id的页面
 */
- (void)gotoPage:(PMViewController *)goViewController selfView:(UIViewController*)selfView;

/*
 *跳转到对应id的页面，同时传递页面参数
 *@params 页面参数
 */
- (void)gotoPage:(PMViewController *)goViewController withParams:(id)params selfView:(UIViewController*)selfView;

/*
 *跳转到对应id的页面
 *@backPageId 返回页面id
 */
- (void)gotoPage:(PMViewController*)goViewController withBackPageView:(PMViewController*)backPageView selfView:(UIViewController*)selfView;

/*
 *跳转到对应id的页面，同时传递页面参数
 *@params 页面参数
 *@backPageId 返回页面id
 */
- (void)gotoPage:(PMViewController *)goViewController
      withParams:(NSMutableDictionary*)params
  withBackPageView:(PMViewController*)backPageView selfView:(UIViewController*)selfView;

- (void)gotoBackPage:(PMViewController *)pmViewController;

/*
 *跳转到首页
 *@selfview  当前自己的viewController,一般传：self
 */
-(void)gotoPageRootViewController:(UIViewController *)selfView;
@end
